package com.tyk.bookstore.front.order.strategy.split.model;


import com.tyk.bookstore.front.common.core.model.enume.BaseEnum;
import com.tyk.bookstore.front.order.strategy.split.OrderSplitAction;
import com.tyk.bookstore.front.order.strategy.split.impl.MinPackageStrictSplitAction;
import com.tyk.bookstore.front.order.strategy.split.impl.ShortDistanceStrictSplitAction;

/**
 * @author tyk
 * @description SplitMode
 */
public enum SplitMode implements BaseEnum {
    // TODO
    AUTO(0, MinPackageStrictSplitAction.class),
    MIN_PACKAGE(1, MinPackageStrictSplitAction.class),
    SHOR_DISTANCE(2, ShortDistanceStrictSplitAction.class);


    private final Integer code;
    private final Class<? extends OrderSplitAction> clazz;

    SplitMode(Integer code, Class<? extends OrderSplitAction> clazz) {
        this.code = code;
        this.clazz = clazz;
    }

    @Override
    public Integer value() {
        return this.code;
    }


    /**
     * 获取Action类名
     *
     * @return Action类名，首字母大写
     */
    public String getClazzName() {
        return clazz.getSimpleName();
    }
}
